home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / ddsrv.zip / D&DSERVE.TXT < prev    next >
Text File  |  1992-08-09  |  4KB  |  90 lines

  1. D&DSERVE.DLL
  2. DLL to Support Win 3.1 Drag 'n Drop Server Capability
  3. by Jonathan Zuck
  4. Published in the August 1992 Windows Tech Journal
  5. This file contains the description for use by VB programmers
  6.  
  7. Function Summaries:
  8. DropSelItems    Drops the selected files in a multi-select List Box
  9. DropAllItems    Drops all the files in a list box
  10. DropBuff        Drops files contained in a passed buffer
  11.  
  12.  
  13. Function Declarations:
  14. Declare Function DropSelItems Lib "D&DSERVE.DLL" (ByVal hList, ByVal Path$, ByVal nButton)
  15. Declare Function DropAllItems Lib "D&DSERVE.DLL" (ByVal hList, ByVal nButton)
  16. Declare Function DropBuff Lib "D&DSERVE.DLL" (ByVal Buff$, ByVal nButton)
  17.  
  18.  
  19. Function Details:
  20.  
  21. DropSelItems: (D&DTEST1.MAK)
  22.         You must have a multi-select list box to use this function. Most of
  23. you will be using those list boxes available from third parties such as
  24. Crescent, MicroHelp and Sheridan. However, to make the demo more generalized,
  25. I modified Costas' MultiPik demo to accomodate the needs of a file list.
  26. Unfortunately, this means that it's a little more complicated than it needs
  27. to be. The real demo code for this function would look something like this:
  28.  
  29. Sub MyFileList_MouseDown (Button As Integer, X As Single, Y as Single)
  30.         Path$ = Dir1.Path + "\"
  31.         hTarget = DropSelItems (MyFileList.hWnd, Path$, Button)
  32. End Sub
  33.  
  34. where hTarget will be the hWnd of the Window on which the selected files
  35. were dropped or Zero if the mouse was not released over a valid window.
  36. One caveat is that the left mouse button will generally remove the
  37. selections from an extended selection list box (the File manage does a
  38. ton of special processing). Therefore, you might want to specify for the
  39. user that the Right mouse button be used to drag from the list box.
  40.  
  41.  
  42. DropAllItems: (D&DTEST2.MAK)
  43.         This function has two advantages. First, it does not require a
  44. multi-select list box so those of you without add-ons will be able to
  45. use it. Second, it is capabile of dealing with files from multiple
  46. directories which DropSelItems (or even FileManager) is not capable of.
  47. Keep in mind that since you do not pass the path to this funtion, each
  48. file name in the list must be fully qualified. When used, this function
  49. will drop all of the items in the list on the target window.
  50.  
  51. DropBuff:   (D&DTEST3.MAK)
  52.         This function is provided primarily for those programming systems
  53. that are not able to use a standard list box or have special needs. In
  54. this case, you are essentially constructing the buffer that will be sent
  55. to the target window. The format of this buffer is a fully qualified
  56. filename, followed by a null, followed by another filename+NULL, etc., and
  57. finally terminated by another null.
  58.         Visual Basic will add the terminating null so you don't need to
  59. worry about the second one. You just need to construct a strong like so:
  60.  
  61. N$ = Chr$(0)
  62. Buff$ = "C:\AUTOEXEC.BAT" + N$  + "C:\DOS\README.TXT" + N$
  63.  
  64. and then pass it ByVal to the function. I dont't generally recommend this
  65. function as it is the least intuitive to the user but it might be helpful
  66. under special circumstances.
  67.  
  68. Testing your Code:
  69.         I have found WRITE to be the best place to test these functions
  70. as it is one of the only WINAPPs that supports the dropping of multiple
  71. files (into the client area, *not* on the icon!).
  72.  
  73. Source Code:
  74.         The TPW source code for D&DSERVE is available in Lib 9 of CLMFORUM
  75. and was first published in the August 1992 issue of the Windows Tech
  76. Journal. For explanations of how these functions work, please contact
  77. Oakley Publishing for back issues.
  78.  
  79.         For more information or subscriptions to the Windows Tech Journal,
  80. call (800) 234 - 0386 or outside of the US, (503) 747 - 0800. The fax number
  81. is (503) 747 - 0071. Alternatively, you may reach the editor, J.D. Hildebrand
  82. (until he becomes too popular) here on CIS at id: 76701,32. The journal
  83. can be reached by mail at:
  84.  
  85.         Windows Tech Journal
  86.         P.O. Box 70167
  87.         Eugene, OR 97401-0110
  88.  
  89. Thanks a lot for your interest! -=- Jonathan
  90.